<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/3/14 0014
 * Time: 上午 10:53
 */
namespace app\common\validate;

class ProductgetListValidate extends BaseValidate{
    protected $rule = [
        'category' => 'require|checkcategory',
        'type' => 'require|checktype',
    ];

    protected $message = [
        'category' => '分类错误!',
        'type' => '类型错误',
    ];

    protected function checkcategory($value){
        if(isset($value)){
            return true;
        }
        return false;

    }

    protected function checktype($value){
        if(in_array($value,[0,1,2,3,4,5,6])){
            return true;
        }
        return false;
    }
}